home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / sc3x04.exe / GETNETSN.C < prev    next >
C/C++ Source or Header  |  1993-08-05  |  3KB  |  69 lines

  1. //   IMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM;
  2. //   :                                                                    :
  3. //   : module:      getnetsn.c                                            :
  4. //   : abstract:    This module shows how to make 3.x system calls using  :
  5. //   :              the F2 Shell Interface for the Get Network Serial     :
  6. //   :              Number API, obviously it requires the NetWare Shell.  :
  7. //   :                                                                    :
  8. //   : environment: NetWare 3.x v3.11                                     :
  9. //   :              Borland C 3.1                                         :
  10. //   :                                                                    :
  11. //   :  This software is provided as is and carries no warranty           :
  12. //   :  whatsoever.  Novell disclaims and excludes any and all implied    :
  13. //   :  warranties of merchantability, title and fitness for a particular :
  14. //   :  purpose.  Novell does not warrant that the software will satisfy  :
  15. //   :  your requirements or that the software is without defect or error :
  16. //   :  or that operation of the software will be uninterrupted.  You are :
  17. //   :  using the software at your risk.  The software is not a product   :
  18. //   :  of Novell, Inc. or any of subsidiaries.                           :
  19. //   HMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM<
  20. //
  21. //                         ****** N O T I C E ******
  22. //
  23. //     This software is considered pre-release and may be used at your own
  24. //     risk and has been provided due to the many requests of our cust-
  25. //     omers.  Support for this module will be provided at the sole
  26. //     discretion of Novell, Inc.
  27. //
  28.  
  29. #include <stdio.h>
  30. #include <string.h>
  31. #include <stdlib.h>
  32. #include <conio.h>
  33. #include <dos.h>
  34. #include <fcntl.h>
  35. #include <sys\types.h>
  36. #include <sys\stat.h>
  37.  
  38. #include "nwsys.c"
  39.  
  40. struct  {
  41.      WORD   sflen;          // length of the structure
  42.      BYTE   sfcode;         // the subfunction code
  43. }Request;
  44.  
  45. struct  {
  46.      LONG   serverSerialNumber;
  47.      WORD   applicationNumber;
  48. }Reply;
  49.  
  50. int main()
  51. {
  52.     int retCode, i;
  53.  
  54.     Request.sflen  = sizeof(Request);
  55.     Request.sfcode = 0x12;
  56.  
  57.     retCode = NWSystemCall(0x17, &Request, sizeof(Request),
  58.                                  &Reply,   sizeof(Reply));
  59.  
  60.     if (retCode != 0) {
  61.         printf("Get Network Serial Number call failed.  Retcode = %d\n",
  62.             retCode);
  63.         return(-1);
  64.     }
  65.     printf("Server serial number: 0x%lx, Application number: 0x%x\n",
  66.         DWordSwap(Reply.serverSerialNumber), WordSwap(Reply.applicationNumber));
  67.     return(0);
  68. }
  69.